<template>
	<view class="content">
		<view class="logo-group-view">
			<image :src="base.JavaimgUrl + '/login/logo.png'"></image>
		</view>
		<view @tap="logoutAction()" class="logout-btn">退出登录</view>

		<view class="sync" @click="syncData">同步数据</view>

		<uv-popup ref="popup" @change="change" round="10">
			<view class="pop-group">
				<text class="pop-title">退出登录</text>
				<text class="pop-content">请确认是否退出账号</text>
				<view style="display: flex;width: 100%;">
					<view class="pop-btn-cancel" @click="popup.close()">取消操作</view>
					<view class="pop-btn-sure" @click="confirmClick()">退出登录</view>
				</view>
			</view>
		</uv-popup>
	</view>
</template>

<script setup>
import api from '../../common/api';
import base from '@/common/baseURL.js';
import { useUserinfoStore } from '@/stores/userInfo';
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
const userInfo_Store = useUserinfoStore();
const popup = ref()
const syncData = async () => {
	const res = await api.syncOrders_API({ day: 2 })
	if (res.code === 10000) {
		uni.showToast({
			title: '申请成功..请稍等再看',
			icon: 'none'
		})
	}
}
const logoutAction = () => {
	popup.value.open()
}
const confirmClick = () => {
	userInfo_Store.Logout()
}
</script>

<style scoped>
.content {
	display: flex;
	flex-direction: column;
	background-color: #FFFFFF;
	width: 100vw;
	height: 100vh;
}

.logo-group-view {
	width: 100vw;
	height: 100vw;
	display: flex;
	align-items: center;
	justify-content: center;
}

.logo-group-view image {
	width: 210rpx;
	height: 198rpx;
}

.logout-btn {
	margin-left: 50rpx;
	margin-right: 50rpx;
	margin-top: 160rpx;
	background: linear-gradient(138deg, #F7CB47 0%, #D4CE4E 100%);
	border-radius: 88rpx;
	line-height: 88rpx;
	text-align: center;
	font-size: 32rpx;
	font-family: PingFangSC-Regular, PingFang SC;
	font-weight: 400;
	color: #FFFFFF;
}

.pop-group {
	background-color: #FFFFFF;
	border-radius: 20rpx;
	width: 580rpx;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.pop-title {
	line-height: 108rpx;
	text-align: center;
	color: #333333;
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: 600;
}

.pop-content {
	font-family: PingFang SC;
	font-weight: 400;
	font-size: 28rpx;
	color: #666666;
}

.pop-btn-cancel {
	font-size: 28rpx;
	font-family: MiSans-Regular, MiSans;
	font-weight: 400;
	color: #666666;
	text-align: center;
	line-height: 64rpx;
	border-radius: 10rpx;
	background-color: #F5F5F5;
	flex: 1;
	margin-left: 50rpx;
	margin-top: 40rpx;
	margin-bottom: 40rpx;
}

.pop-btn-sure {
	font-size: 28rpx;
	font-family: MiSans-Regular, MiSans;
	font-weight: 400;
	color: #FFFFFF;
	text-align: center;
	line-height: 64rpx;
	margin-left: 24rpx;
	background: linear-gradient(138deg, #F7CB47 0%, #C2CF51 100%);
	border-radius: 10rpx;
	flex: 1;
	margin-right: 50rpx;
	margin-top: 40rpx;
	margin-bottom: 40rpx;
}

.sync {

	font-size: 30rpx;
	text-align: center;
	color: red;
	margin-top: 60rpx;
}
</style>